Diagnose a failing server, rather than just locking up the whole daemon.
authorEwan Mellor <ewan@xensource.com>
Mon, 4 Dec 2006 13:56:27 +0000 (13:56 +0000)
committerEwan Mellor <ewan@xensource.com>
Mon, 4 Dec 2006 13:56:27 +0000 (13:56 +0000)
Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/server/SrvServer.py

index 1b0ed9c0db0c52039df287869a203d2bc1da5d2c..6bfff3a3189e8eb83e69fa4b6f61afabdac29179 100644 (file)
@@ -111,6 +111,7 @@ class XendServers:
             # check for when all threads have initialized themselves and then
             # close the status pipe
 
+            retryCount = 0
             threads_left = True
             while threads_left:
                 threads_left = False
@@ -122,6 +123,14 @@ class XendServers:
 
                 if threads_left:
                     time.sleep(.5)
+                    retryCount += 1
+                    if retryCount > 60:
+                        for server in self.servers:
+                            if not server.ready:
+                                log.error("Server " +
+                                          server.__class__.__name__ +
+                                          " did not initialise!")
+                        break
 
             if status:
                 status.write('0')